package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.Supplier;
import com.atguigu.jxc.service.SupplierService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author gwk
 * @create 2021 -09 -04 13:39
 */
@RestController
@RequestMapping("/supplier")

public class SupplierController {
    /**
     * 分页查询供应商
     */
    @Autowired
    SupplierService supplierService;

    @PostMapping("/list")
    public Map<String,Object> list(Integer page,Integer rows,String supplierName){
        return supplierService.list(page, rows, supplierName);
    }

    /**
     * 供应商添加或修改
     */
    @PostMapping("/save")
    public ServiceVO save(Supplier supplier){
        return supplierService.save(supplier);
    }
    /**
     * 供应商删除
     */
    @PostMapping("/delete")
    public ServiceVO delete(String ids){
        return supplierService.delete(ids);
    }
}
